home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
-
- # Make sure errors report (since we try to weed out potential spurious ones)
- set -e
-
- # ncurses 3.x used to look in /usr/lib/terminfo and /usr/lib/tabset, but
- # since ncurses 4.x we've been creating compatibility symlinks in the
- # postinst. As of ncurses 5.4-9 we no longer create the symlinks, but
- # we must continue to clean up the old symlinks until there has been
- # a stable release not containing them.
-
- if [ -L /usr/lib/terminfo ]; then
- rm -f /usr/lib/terminfo
- fi
- if [ -L /usr/lib/tabset ]; then
- rm -f /usr/lib/tabset
- fi
-
- # Versions of ncurses prior to 5.4-9 put terminfo entries in /etc/terminfo.
- # We continue to search /etc/terminfo, but now we place no terminfo entries
- # there; they go in /lib/terminfo. Remove any unmodified terminfo entries
- # from /etc/terminfo - we have to do this by hand, because they were
- # formerly conffiles, so dpkg will preserve them.
-
- rm_conffile() {
- CONFFILE="$1"
-
- if [ -e "$CONFFILE" ]; then
- md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
- old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE '{s/.* //;p}}\" /var/lib/dpkg/status`"
- if [ "$md5sum" = "$old_md5sum" ]; then
- echo "Removing obsolete conffile $CONFFILE ..."
- rm -f "$CONFFILE"
- fi
- fi
- }
-
- case "$1" in
- install|upgrade)
- if test -n "$2" && dpkg --compare-versions "$2" lt "5.4-9"; then
- entries=$(find /etc/terminfo -mindepth 2 -maxdepth 2 -type f)
- for f in $entries; do rm_conffile "$f"; done
- dirs=$(find /etc/terminfo -type d -empty)
- for d in $dirs; do rmdir $d; done
- fi
- esac
-
-
-